package com.wp.design.observer.v2;

import com.google.common.eventbus.Subscribe;
import com.wp.design.observer.Course;
import com.wp.design.observer.Question;

import java.util.Observable;
import java.util.Observer;

public class Teacher {
	private String teacherName;

	public Teacher(String teacherName) {
		this.teacherName = teacherName;
	}


	@Subscribe
	public void update( Object arg) {
		Muti muti = (Muti)arg;

		System.out.println(teacherName+"的"+muti.getCourse().getCourseName()
				+"收到了一个"+muti.getQuestion().getUserName()+"同学发来的问题，内容："+muti.getQuestion().getContent());
	}
}
